<?php

use yii\helpers\Html;
use app\core\lib\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Ad */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="box-body">
    <?php $form = ActiveForm::begin([
        'options' => ['class' => 'form-horizontal'],
        'fieldConfig' => [
            'template' => "{label}\n<div class=\"col-lg-6\">{input}</div>\n<div class=\"col-lg-2\">{error}</div>",
            'labelOptions' => ['class' => 'col-lg-1 control-label'],
        ],
    ]); ?>

    <?= $form->field($model, 'title')->hint('aaaa')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'remark')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'pic')->widget(\app\core\widgets\webuploader\WebUploader::className()) ?>

    <?= $form->field($model, 'starttime')->widget(\app\core\widgets\datetimepicker\Datetimepicker::className()) ?>

    <?= $form->field($model, 'endtime')->widget(\app\core\widgets\datetimepicker\Datetimepicker::className()) ?>

    <?= $form->field($model, 'position_id')->dropDownList(\app\models\AdPosition::treeArr(), ['prompt' => '===请选择广告位===' ,'encode' => false]) ?>

    <?= $form->field($model, 'sort')->textInput() ?>

    <?= $form->field($model, 'status')->textInput() ?>


    <?= Html::submitButton(Html::tag('span', '', ['class' => 'glyphicon glyphicon-floppy-disk']) . ' ' .
        ($model->isNewRecord ? 'Create' : 'Save'),
        ['class' => $model->isNewRecord ? 'btn btn-success pull-right' : 'btn btn-primary pull-right']) ?>
    <?php ActiveForm::end(); ?>
</div>
<?php $this->render('@app/modules/admin//views/layouts/modal-form', ['form' => $form]) ?>

